﻿Imports System.Data
Imports System.Data.SqlClient
Imports Datos.Acceso_Datos
Public Class Transaccion
    Inherits Coneccion
    Protected MTransaccion As SqlTransaction
    Protected EnTransaccion As Boolean
    Sub Iniciar_Transaccion()
        Try
            MTransaccion = con.BeginTransaction
            EnTransaccion = True
        Catch ex As Exception
            Throw
        Finally
            EnTransaccion = False
        End Try
    End Sub
    Sub Terminar_Transaccion()
        Try
            MTransaccion.Commit()
        Catch ex As Exception
            Throw
        Finally
            MTransaccion = Nothing
            EnTransaccion = False
        End Try
    End Sub
    Sub Abortar_Transaccion()
        Try
            MTransaccion.Rollback()
        Catch ex As Exception
            Throw
        Finally
            MTransaccion = Nothing
            EnTransaccion = False
        End Try
    End Sub
End Class
